package cn.xiaou.dao;

import java.sql.SQLException;
import java.util.List;

import cn.xiaou.domain.ModifyPwd;
import cn.xiaou.domain.Stock;
import cn.xiaou.domain.Transaction;
import cn.xiaou.domain.User;
import cn.xiaou.domain.UserReal;

public interface UserDao {

	Integer registerUser(User user) throws SQLException;

	Long isExistUserByUsername(String username) throws SQLException;

	Long checkExistEmail(String email) throws SQLException;

	User loginUser(User user) throws SQLException;

	void activationMailbox(Integer uid) throws SQLException;

	User userByUsername(String username) throws SQLException;

	User userByEmail(String email) throws SQLException;

	Integer addModifyPwd(ModifyPwd modify )throws SQLException;

	Long checkModifyPwdBycode(String codeStr, Integer modify_id) throws SQLException;

	void updateModifyPwdState(Integer modify_id) throws SQLException;

	User findUidByModify_id(Integer modify_id) throws SQLException;

	Integer updatePassword(User user) throws SQLException;


	long checkModifyPwding(User user)throws SQLException;

	long checkModifyCount(User user, String now)throws SQLException;

	Integer addRealName(UserReal userReal) throws SQLException;

	UserReal checkRealnameExist(User user) throws SQLException;
	 void updateStockCount(Transaction tran) throws SQLException;
	List<Stock> findAllStock() throws SQLException;

	void addOrder(Transaction tran)throws SQLException;;

	void pay(Transaction tran)throws SQLException;


	Integer Recharge(User user, Integer money)throws SQLException;

	List<Transaction> userTransaction(User user)throws SQLException;

	Stock findTransactionBysid(Integer sid) throws SQLException;

	void addMoney(Integer uid, Double money) throws SQLException;

	void updateTransaction(Transaction tran) throws SQLException;

	Integer checkOrderZero(Integer tid) throws SQLException;

	void deleteTransaction(Transaction tran) throws SQLException;

	void updateCount(Transaction tran, Integer count) throws SQLException;

	Integer findDistinct(Transaction tran) throws SQLException;

	void updateOrder(Transaction tran, Integer state) throws SQLException;




}
